package ProjectTeam39.Domains;
/**
 * Appointment.java
 * Represents a patient's appointment and contains all associated information.
 * @author SeanPohjalainen
 * @version 1.0
 */
public class Appointment {
	/** time of appointment */
	private int time;
	/** date of appointment */
	private Date date;
	/** the patient's reason for the appt */
	private String reason;
	/** the attending doctor */
	private Doctor doctor;
	/** the patient the appt is for */
	private Patient patient;
	
	public Appointment(){
		this(null, 0, null, null, null);
	}
	/**
	 * Creates an Appointment object.
	 * 
	 * @param p the patient the appointment is associated with
	 * @param t the time of day
	 * @param d the date of appt
	 * @param r the reason for appt
	 * @param d the attending doctor
	 */
	public Appointment(Patient p, int t, Date d, String r, Doctor doc){
		this.time = t;
		this.date = d;
		this.reason = r;
		this.doctor = doc;
		this.patient = p;
	}
	
	/**
	 * Returns appt's date.
	 * @return date object
	 */
	public Date getDate(){
		return date;
	}
	
	/**
	 * Returns the reason.
	 * @return reason string
	 */
	public String getReason(){
		return reason;
	}
	
	/**
	 * Returns the attending doctor 
	 * @return doctor's name
	 */
	public Doctor getDoctor(){
		return doctor;
	}
	
	/**
	 * Returns the appt time
	 * @return time as an int
	 */
	public int getTime(){
		return time;
	}
	
	/**
	 * Returns the patient
	 * @return patient object
	 */
	public Patient getPatient(){
		return patient;
	}
	
	/**
	 * Set date
	 * @param d
	 */
	public void setDate(Date d){
		this.date = d;
	}
	
	/**
	 * Set reason
	 * @param r
	 */
	public void setReason(String r){
		this.reason = r;
	}
	
	/**
	 * Set doctor
	 * @param d
	 */
	public void setDoctor(Doctor d){
		this.doctor = d;
	}
	
	/**
	 * Set time.
	 * @param t
	 */
	public void setTime(int t){
		this.time = t;
	}
	
	/**
	 * Convert the appt data into a string.
	 * @return the String containing the appointments data.
	 */
	public String toString(){
		return ("Patient: " + patient.getName() + '\n' + "Doctor: " + doctor.getName() + 
				'\n' + "Date: " + date.toString() + 
				 '\n' + "Time: " + Integer.toString(time) + '\n' + "Reason: " + reason);
		
	}
}
